package com.ruoyi.dl.controller.wechat;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.dl.domain.DlProgress;
import com.ruoyi.dl.service.IDlProgressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 发单进度Controller
 *
 * @author wangshouli
 * @date 2021-01-05
 */
@Controller
@RequestMapping("/wechat/dl/progress")
@CrossOrigin(allowCredentials = "true")
public class WeChatDlProgressController extends BaseController {

    @Autowired
    private IDlProgressService iDlProgressService;

    /**
     * 查询所有进度上传
     *
     * @return
     */
    @PostMapping("selectProgressALLList")
    @ResponseBody
    public AjaxResult selectProgressALLList() {
        return AjaxResult.success("成功", iDlProgressService.newSelectDlProgressList(new DlProgress()));
    }

    /**
     * 根据用户ID查询所有进度上传
     *
     * @param userId 用户ID
     * @return
     */
    @PostMapping("selectProgressById")
    @ResponseBody
    public AjaxResult selectProgressById(Integer userId) {
        return AjaxResult.success("成功", iDlProgressService.selectDlProgressByUserId(userId));
    }

}
